// 导航守卫
import router from './router'
import store from './store'
const white = ['/login', '/404']
router.beforeEach((to, from, next) => {
  console.log(white.includes(to.path))
  if (white.includes(to.path)) {
    return next()
  }
  if (store.state.token) {
    next()
  } else {
    next('/login')
  }
})
